<?php
require_once ("Logger.php");
require_once ("Util.php");
/**
 * ArticleDisplayer
 * Created on 18.03.2009 0:10:07
 * @author nikolai
 */
class ArticleDisplayer {
    var $root;
    var $logger;

    function ArticleDisplayer($root) {
        $this->logger = new Logger($root, "ArticleDisplayer");
        $this->root = $root;
    }

    function display($pathToArticle) {
        if (!file_exists($pathToArticle)) {
            $msg = "file '$pathToArticle' does not exist";
            $this->logger->applogSevereDie($msg);
        }

        ob_start();
        include("$pathToArticle");
        $includedphp = ob_get_contents();
        ob_end_clean();

        echo replaceEscapes($includedphp);
    }
}
?>
